<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3//EN">
<HTML><HEAD>
<TITLE>IBM Visualization Data Explorer Programmer&#39;s Reference</TITLE>

<META HTTP-EQUIV="abstract" CONTENT="IBM Visualization Data Explorer
Programmer&#39;s Reference">
<META HTTP-EQUIV="contact" CONTENT="IBM Visualization Data Explorer
(ibmdx@watson.ibm.com)">
<META HTTP-EQUIV="owner" CONTENT="IBM Visualization Data Explorer
(ibmdx@watson.ibm.com)">
<META HTTP-EQUIV="updated" CONTENT="Tue, 16 Sep 1997 ">
<META HTTP-EQUIV="review" CONTENT="Fri, 14 Aug 1998 ">

<META HTTP-EQUIV="keywords" CONTENT="GRAPHICS VISUALIZATION VISUAL PROGRAM DATA
MINING">
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
</HEAD><BODY BGCOLOR="#FFFFFF">

<A NAME="Top_Of_Page"></A>
<H1>IBM Visualization Data Explorer Programmer&#39;s Reference</H1>
<B>&#91; <A HREF="#Bot_Of_Page">Bottom of Page</A> &#124; <A
HREF="progu311.htm">Previous Page</A> &#124; <A HREF="progu313.htm">Next
Page</A> &#124; <A HREF="../proguide.htm#ToC">Table of Contents</A> &#124; <A
HREF="progu097.htm#PToC20">Partial Table of Contents</A> &#124; <A
HREF="progu344.htm#HDRINDEX_START">Index</A> &#93;</B><HR><P>
<H3><A NAME="HDRDXSE" HREF="progu097.htm#PToC_406">DXSetError, DXErrorReturn,
DXErrorGoto</A></H3>
<A NAME="IDX2066"></A>
<A NAME="IDX2067"></A>
<A NAME="IDX2068"></A>
<A NAME="IDX2069"></A>
<A NAME="IDX2070"></A>
<A NAME="IDX2071"></A>
<A NAME="IDX2072"></A>
<A NAME="IDX2073"></A>
<P><STRONG>Function</STRONG>
<P>
Set an error code and an explanatory message.
<P><STRONG>Syntax</STRONG>
<BR>
<TT><STRONG><BR>
&#35;include &lt;dx/dx.h&gt;<BR>
<P><BR>
Error DXSetError(ErrorCode e, char *message, ...)<BR>
#define DXErrorReturn(e,s) {DXSetError(e,s); return ERROR;}<BR>
#define DXErrorGoto(e,s) {DXSetError(e,s); goto error;}<BR>
</STRONG></TT><BR>
<P><STRONG>Functional Details</STRONG>
<P>
Modules that return
<TT><STRONG>ERROR</STRONG></TT> should in many cases
also set the error code and error
message.  <TT><STRONG>DXSetError</STRONG></TT>
provides the interface to do this, and
needs
to be called only once for each error.
<P>
If a Data Explorer function returns
an error and sets an
error code, the caller should usually return
<TT><STRONG>ERROR</STRONG></TT> without using one of these routines,
since the error message set by the Data Explorer function
will usually be more informative.  If the error code is set by the
Data Explorer function and the calling program proceeds
without returning <TT><STRONG>ERROR</STRONG></TT>,
<TT><STRONG>DXResetError</STRONG></TT> should be called.
<P>
If the Data Explorer function does not set the error code,
it is the calling function&#39;s responsibility to do so using one of
these routines.
<P>
The <TT><STRONG>message</STRONG></TT> may be a <TT><STRONG>printf</STRONG></TT>
format string, in which case
additional arguments as required by the format string must be
specified.  Messages beginning with the pound sign,
<TT><STRONG>&#35;</STRONG></TT>, are reserved for system use.
<P>
Additional information can be added to an error message using the
<TT><STRONG>DXAddMessage</STRONG></TT> function.
<P>
<TT><STRONG>DXErrorReturn</STRONG></TT> calls
<TT><STRONG>DXSetError</STRONG></TT> and returns from the caller with
return value <TT><STRONG>ERROR</STRONG></TT>.
<P>
<TT><STRONG>DXErrorGoto</STRONG></TT> calls
<TT><STRONG>DXSetError</STRONG></TT> and goes to the label
"error."
This is useful when some clean-up activity is required (e.g.,
freeing allocated memory).
It is the caller&#39;s responsibility to provide the "error" label
in the code.
<P>
The error code <TT><STRONG>e</STRONG></TT> must be one of the following:
<PRE><STRONG>
ERROR_ASSERTION        ERROR_INTERNAL        ERROR_NO_CAMERA
ERROR_BAD_CLASS        ERROR_INVALID_DATA    ERROR_NO_MEMORY
ERROR_BAD_PARAMETER    ERROR_MISSING_DATA    ERROR_NOT_IMPLEMENTED
ERROR_BAD_TYPE                               ERROR_UNEXPECTED
</STRONG>
</PRE>
<P><STRONG>Return Value</STRONG>
<P>
Always return <TT><STRONG>ERROR</STRONG></TT>.
<P><STRONG>See Also</STRONG>
<P>
<TT><STRONG>
<A HREF="progu103.htm#HDRDXAM">DXAddMessage, DXMessageReturn, DXMessageGoto</A>,
<A HREF="progu242.htm#HDRDXMESS">DXMessage</A>,
<A HREF="progu294.htm#HDRDXRE">DXResetError</A>,
<A HREF="progu342.htm#HDRDXW">DXWarning</A>
</STRONG></TT>
<P>
<A HREF="progu055.htm#HDRERRSEC">13.1 , "Error Handling and Messages"</A>.
<P><HR><B>&#91; <A HREF="#Top_Of_Page">Top of Page</A> &#124; <A
HREF="progu311.htm">Previous Page</A> &#124; <A HREF="progu313.htm">Next
Page</A> &#124; <A HREF="../proguide.htm#ToC">Table of Contents</A> &#124; <A
HREF="progu097.htm#PToC20">Partial Table of Contents</A> &#124; <A
HREF="progu344.htm#HDRINDEX_START">Index</A> &#93;</B> <br><b>&#91;<a
href="../allguide.htm">Data Explorer Documentation</a>&nbsp;&#124;&nbsp;<a
href="../qikguide.htm">QuickStart Guide</a>&nbsp;&#124;&nbsp;<a
href="../usrguide.htm">User&#39;s Guide</a>&nbsp;&#124;&nbsp;<a
href="../refguide.htm">User&#39;s Reference</a>&nbsp;&#124;&nbsp;<a
href="../proguide.htm">Programmer&#39;s Reference</a>&nbsp;&#124;&nbsp;<a
href="../insguide.htm">Installation and Configuration
Guide</a>&nbsp;&#93;</b><br><p><b>&#91;<a
href="http://www.research.ibm.com/dx">Data Explorer Home
Page</a>&#93;</b><p><HR ALIGN=LEFT WIDTH=600><b>&#91;<A
HREF="http://www.ibm.com/">IBM Home Page</A>&nbsp;&#124;&nbsp;<A
HREF="http://www.ibm.com/Orders/">Order</A>&nbsp;&#124;&nbsp;<A
HREF="http://www.ibm.com/Search/">Search</A>&nbsp;&#124;&nbsp;<A
HREF="http://www.ibm.com/Assist/">Contact IBM</A>&nbsp;&#124;&nbsp;<A
HREF="http://www.ibm.com/Legal/">Legal</A>&nbsp;&#93;</b><hr><p>
<A NAME="Bot_Of_Page"></A>
</BODY></HTML>
